import { NgModule } from '@angular/core';
import { HomeComponent } from './home.component';
import { RouterModule, Routes } from '@angular/router';
import { ShareModule } from 'src/app/share/share.module';
import { RecommendModule } from './recommend/recommend.module';

const routes: Routes = [
  {
    path: '',
    component: HomeComponent,
    children: [
      { path: '', redirectTo: 'recommend', pathMatch: 'full' },
      { path: 'recommend', loadChildren: () => import('./recommend/recommend.module').then(mod => mod.RecommendModule) },
      { path: 'my', loadChildren: () => import('./my/my.module').then(mod => mod.MyModule) },
      { path: 'about', loadChildren: () => import('./about/about.module').then(mod => mod.AboutModule) },
    ]
  },
]

@NgModule({
  declarations: [HomeComponent],
  imports: [
    RecommendModule,
    ShareModule,
    RouterModule.forChild(routes)
  ]
})
export class HomeModule { }
